<template>
  <div>
       <Modal2 :isOpen="modalIsOpen" @close-modal="onModalClose">
          <div>我的弹框</div>
        </Modal2>

      <div>
          <button @click="onpenModal">打开弹窗</button>
      </div>
  </div>
</template>

<script>
import {ref} from 'vue'
import Modal2 from './Modal2'
export default {
components: {
 Modal2   
},

setup() {
    const modalIsOpen = ref(false)

    const onpenModal = ()=>{
        modalIsOpen.value = true
    }
    const onModalClose = ()=> {
        modalIsOpen.value = false
    }
    return {
        modalIsOpen,
        onpenModal,
        onModalClose
    }
}
}
</script>

<style>

</style>